package com.IR.product.action;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.IR.product.service.BNormsBIZ;
import com.IR.shop.po.Norms;

import net.sf.json.JSONArray;

@Controller
public class BNormsAction {

	@Resource
	public BNormsBIZ biz; 
	private Norms norms;
	private List<Norms> list;
	public Norms getNorms() {
		return norms;
	}
	public void setNorms(Norms norms) {
		this.norms = norms;
	}
	public List<Norms> getList() {
		return list;
	}
	public void setList(List<Norms> list) {
		this.list = list;
	}
	@RequestMapping(value="/showpronorms.do")
	public void showPronorms(Long proid,HttpServletResponse response) {
		response.setCharacterEncoding("utf-8");
		response.setHeader("Access-Control-Allow-Origin", "*");
		list=biz.selectPronorms(proid);
		try {
			PrintWriter out=response.getWriter();
			String str=JSONArray.fromObject(list).toString();
			out.println(str);
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
}
